package com.kandy.ktools.core.utils;//package com.kandy.tissot.core.utils;
//
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.FileNotFoundException;
//import java.io.IOException;
//import java.text.SimpleDateFormat;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.Map;
//
//import javax.imageio.ImageIO;
//
//import com.google.zxing.BarcodeFormat;
//import com.google.zxing.BinaryBitmap;
//import com.google.zxing.DecodeHintType;
//import com.google.zxing.EncodeHintType;
//import com.google.zxing.MultiFormatReader;
//import com.google.zxing.MultiFormatWriter;
//import com.google.zxing.NotFoundException;
//import com.google.zxing.WriterException;
//import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
//import com.google.zxing.client.j2se.MatrixToImageWriter;
//import com.google.zxing.common.HybridBinarizer;
//import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
//
///**
// * Created by kandy on 18/10/18.
// */
//public class QRcodeUtil {
//    private static final Map<EncodeHintType, ErrorCorrectionLevel> encodeMap = new HashMap<EncodeHintType, ErrorCorrectionLevel>();
//    private static final Map<DecodeHintType, ErrorCorrectionLevel> decodeMap=new HashMap<DecodeHintType, ErrorCorrectionLevel>();
//    private static final String charset="UTF-8",format="png";
//    private static final int size=150;
//    private QRcode() {}
//
//    public static void createQRCode(String data, File file)
//            throws WriterException, IOException {
//        MatrixToImageWriter.writeToFile(new MultiFormatWriter().encode(
//                new String(data.getBytes(charset), charset),
//                BarcodeFormat.QR_CODE, size, size, encodeMap), format, file);
//    }
//
//    public static String readQRCode(String filePath)
//            throws FileNotFoundException, IOException, NotFoundException {
//        return new MultiFormatReader().decode(new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(ImageIO.read(new FileInputStream(filePath))))),decodeMap).getText();
//    }
//}
